﻿<project name="StockholmsStad.Windows.UI" default="Info">
  	<include buildfile="Properties.Include" />

	<target name="Run">
		<call target="Info" />
    <call target="CopyConfigurationFiles" />
    <call target="Build" />
    <call target="CopyToDeployFolder" />
  </target>

	<target name="Info">
		<echo message="${ProjectName} buildfile..." />
	</target>

  <target name="CopyConfigurationFiles">
    <copy todir="${ProjectFolder}\${ProjectName}\" overwrite="true">
      <fileset basedir="${Global.ConfigFolder}\${ProjectName}" >
        <include name="**/*.config" />
      </fileset>
    </copy>
  </target>

  <target name="Build">
		<msbuild project="${ProjectFolder}\${ProjectName}.sln">
			<arg value="/t:rebuild" />
			<arg value="/p:Configuration=${Configuration}" />
			<arg value="/v:m" />
		</msbuild>

    <echo message="${DEVENVEXE} ${SetupProjectFolder}\${SetupProjectName}.vdproj /rebuild ${Configuration}" />
    <exec program="${DEVENVEXE}" commandline="/rebuild ${Configuration} ${ProjectFolder}\${ProjectName}.sln /project ${SetupProjectFolder}\${SetupProjectName}.vdproj " />
  </target>

  <target name="CopyToDeployFolder">
    <nant buildfile="${Global.CoreTargetsBuildFile}" target="Core.CopySetupToDeployFolder" inheritall="true">
      <properties>
        <property name="Project.DeployFolder" value="${Global.WinFolder}" />
        <property name="Project.ProjectFolder" value="${SetupProjectFolder}" />
      </properties>
    </nant>
  </target>
  
</project>